import 'package:fly/generated/json/base/json_field.dart';
import 'package:fly/generated/json/user_entity.g.dart';
import 'dart:convert';

@JsonSerializable()
class UserEntity {

	late String name;
	late int age;
	late List<String> friends;
  
  UserEntity();

  factory UserEntity.fromJson(Map<String, dynamic> json) => $UserEntityFromJson(json);

  Map<String, dynamic> toJson() => $UserEntityToJson(this);

  UserEntity copyWith({String? name, int? age, List<String>? friends}) {
      return UserEntity()..name= name ?? this.name
			..age= age ?? this.age
			..friends= friends ?? this.friends;
  }
    
  @override
  String toString() {
    return jsonEncode(this);
  }
}